package com.co.notaweb.entities;

import java.util.List;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

/**
 * @author PC
 * @version 1.0
 * @created 13-nov-2011 12:14:24
 */
@Entity
@DiscriminatorValue("DOCENTE")
@NamedQueries({ @NamedQuery(name = "Docente.consultarDocentePorColegio", query = "SELECT d FROM Docente d INNER JOIN d.colegios c WHERE c.id = :idColegio"),
	@NamedQuery(name = "Docente.consultarDocentesPorIds", query = "SELECT d FROM Docente d WHERE d.id IN (:idsDocente)"),
	@NamedQuery(name = "Docente.consultarDocentesPorNotIds", query = "SELECT d FROM Docente d WHERE d.id NOT IN (:idsDocente)")
	})
public class Docente extends Persona {
	@OneToMany(mappedBy = "docente")
	private List<Asignacion> asignaciones;

	@ManyToMany
	private List<Colegio> colegios;


	public Docente() {

	}

	public List<Asignacion> getAsignaciones() {
		return asignaciones;
	}

	public void setAsignaciones(List<Asignacion> asignaciones) {
		this.asignaciones = asignaciones;
	}

	public List<Colegio> getColegios() {
		return colegios;
	}

	public void setColegios(List<Colegio> colegios) {
		this.colegios = colegios;
	}


}